/*
 * main.cpp
 *
 *  Created on: Jan 20, 2012
 *      Author: avikam
 */

#include "Employee.h"
 
#include "Poco/Path.h"
#include "Poco/Exception.h"

#include <iostream>
#include <stdlib.h>

using namespace std;
using Poco::Path;
using Poco::Exception;

int main(int argc, char** argv)
{
	if (argc != 3)
	{
		Path p(argv[0]);
		cout << "usage: " << p.getBaseName() << " <Work manager name/ip> <Work manager port>" << endl;
		return 1;
	}
    try
    {
        string workManagerAddress(argv[1]);
        unsigned short workManagerPort(atoi(argv[2]));
        Employee employee(workManagerAddress, workManagerPort);
        employee.run();
    }
    catch (Exception& exc)
	{
		cerr << exc.displayText() << endl;
	}
}
